import com.service.AccountService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:bean.xml")
public class SpringClie {

    @Autowired
    private AccountService as;

    @Test
    public void show(){

        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("bean.xml");
        String [] beans=applicationContext.getBeanDefinitionNames();
        for (String name:beans) {
            System.out.println("beanname:"+name);
        }
        //转账
        as.transfer("小李","小王",100f);


    }
}
